//
//  BeanTable.h
//  storeapp
//
//  Created by huangyi on 13-4-17.
//  Copyright (c) 2013年 ios. All rights reserved.
//

#import <Foundation/Foundation.h>

@class BeanObject;
@class BeanDatabase;

@interface BeanTable : NSObject

@property(nonatomic,strong)NSString *tableName;
@property(nonatomic,strong)BeanDatabase *db;

-(BeanObject*)convert:(NSDictionary*)dictionary;

-(int)count;
-(BeanObject*)dispense;
-(BeanObject*)load:(int)rowid;
-(BeanObject*)findOne:(NSString*)condition,... NS_REQUIRES_NIL_TERMINATION;
-(NSArray*)findAll:(NSString*)condition,... NS_REQUIRES_NIL_TERMINATION;
-(BeanObject*)findOrDispense:(NSString*)condition,... NS_REQUIRES_NIL_TERMINATION;
-(BOOL)wipe;
-(NSArray*)getFieldNames;

@end
